
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        table{
            border: 1px solid beige;
            width: 1000px;
            margin: 10px auto;
            text-align: center;
            border-collapse: collapse;
        }
        tr{
            border: 1px solid beige;
            height: 50px;
            text-align: center;
        }
        th,td{
            border: 1px solid beige;

        }
        h2{
            text-align: center;
        }
    </style>
</head>
<body>
<h2>列表</h2>

<%--如果要加button 需要控制地址栏的地址--%>
<br>
<p>欢迎【${uname}】</p>
<table>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>生日</th>
        <th>性别</th>
        <th>职业</th>
        <th>住所</th>
        <th>电话</th>
        <th>操作</th>

    </tr>
    <c:forEach items="${profileList}" var="profile">
        <tr>
            <td>${profile.id}</td>
            <td>${profile.name}</td>
            <td>${profile.birthday}</td>
            <td>${profile.gender}</td>
            <td>${profile.career}</td>
            <td>${profile.address}</td>
            <td>${profile.mobile}</td>
            <td>${profile.picture}</td>
                <%-- 如果return true，那么访问 连接，返回的false，就会阻断访问链接--%>
            <td><a href="detail?profileId=${profile.id}" >明细</a>&nbsp;&nbsp;&nbsp;<a href="toUpdate?profileId=${profile.id}">修改</a></td>
        </tr>
    </c:forEach>

    <tr>
        <td colspan="9">
            <a href="<c:url  value='/?pageIndex=1'></c:url>">首页</a>
            <c:if test="${page.pageIndex > 1}">
                <a href="<c:url  value='/?pageIndex=${page.pageIndex-1}'></c:url>">上一页</a>
            </c:if>
            <c:if test="${page.pageIndex <page.totalPages}">
                <a href="<c:url  value='/?pageIndex=${page.pageIndex+1}'></c:url>">下一页</a>
            </c:if>
            <c:if test="${page.pageIndex ==page.totalPages }">
                <a>下一页</a>
            </c:if>
            <a href="<c:url  value='/?pageIndex=${page.totalPages}'></c:url>">尾页</a>
        </td>
    </tr>
</table>
</body>
</html>